import unittest
import logging,yagmail

import HTMLTestRunner_PY3
from HTMLTestRunner_PY3 import HTMLTestRunner

def Log():
    logging.basicConfig(filename='126yx.log',filemode='a+',
                        level=logging.INFO,
                        format='%(asctime)s %(message)s %(levelname)s %(lineno)s %(filename)s')

def Report():
    HTMLTestRunner_PY3.HTMLTestRunner(open('/TestRunner.py', 'wb'),
                                      description='这是我的报告', title='126邮箱')

def Email(filepath):
    email=yagmail.SMTP(user='1522057104@qq.com',password='mhszldzvffpnjfcc',host='smtp.qq.com')
    email.send(to='1522057104@qq.com',subject='126邮箱',contents='这是126邮箱报告',attachments=filepath)
